<template>
    <view class="content">
		<view>业务合作请点击下方按钮</view>
		<view class="phone" @click="handlePhone()">
			拨打4000-666-591
		</view>
		<view class="phone" @click="handlePhone1">
			我要合作，请联系我
		</view>
	</view>
</template>
<script>
	import { $handleStatistcs } from "@/utils/statistics.js"
	import { saveRecord } from "@/api/find/index.js"
	export default {
		onShow() {
			// #ifdef !APP-PLUS 
			if (!uni.getStorageSync("userId")) {
				this.$handleOpenUrl("/pages/login/index")
			}
			// #endif 
			$handleStatistcs()
		},
		methods:{
			handlePhone() {
				uni.makePhoneCall({
					phoneNumber: '4000-666-591' 
				});
			},
			handlePhone1() {
				// #ifdef APP-PLUS
				if (!uni.getStorageSync("userId")) {
					this.$handleOpenUrl("/pages/login/index")
					return;
				}
				// #endif 
				saveRecord({
					 "userId":uni.getStorageSync("userId"),
					 "mobile":JSON.parse(uni.getStorageSync("userInfo")).user.mobile
				}).then(res=>{
					if(res.code==0) {
						uni.showToast({
							icon:"none",
							title:"我们已经收到信息，会尽快安排专人联系您！"
						})
					}
				})
				
			}
		}
	}
</script>
<style lang="scss" scoped>
	.content{
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 30upx;
		.phone {
			display: block;
			width: 520upx;
			height: 88upx;
			line-height: 88upx;
			background: linear-gradient(87deg, #035ABE, #218EED);
			border-radius: 44upx;
			color: #ffffff;
			text-align: center;
			font-size: 34upx;
			margin: 60upx auto 17upx;
		}
	}
</style>